from django.db import models
from django.contrib.auth.models import User
from utils.modelMixin.statusFiledMixin import ConditionFiled
from utils.modelMixin.timeFiledMixin import CreateAndUpdateTimeFiled


# Create your models here.


class Accounts(models.Model):
    """用户表"""

    user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="accounts")
    avatar = models.ImageField("头像", upload_to="accounts/avatars/%Y/%m/%d/", blank=True)

    # mobile = models.CharField(verbose_name='手机号', max_length=11, db_index=True, null=True, blank=True)

    def __str__(self):
        return self.user.username

    class Meta:
        db_table = "accounts"
        verbose_name = "用户管理表"
        verbose_name_plural = verbose_name
